// 二项式反演
// 测试链接 ：https://www.luogu.com.cn/problem/P4859
// 相关帖子 ：https://www.cnblogs.com/dx123/p/17031773.html
// 相关帖子 ：https://oi-wiki.org/math/combinatorics/combination/#%E4%BA%8C%E9%A1%B9%E5%BC%8F%E5%8F%8D%E6%BC%94
// 提交以下的code，可以直接通过

#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2005;
const int P = 1e9 + 9;
int n, k, a[MAXN], b[MAXN];
int F[MAXN][MAXN];
int f[MAXN];
int C[MAXN][MAXN];

int main()
{
    scanf("%d%d", &n, &k);
    for(int i = 1; i <= n; ++i) scanf("%d", &a[i]);
    for(int i = 1; i <= n; ++i) scanf("%d", &b[i]);

    for(int i = 0; i <= n; ++i) C[i][0] = 1;
    for(int i = 1; i <= n; ++i)
    {
        for(int j = 1; j <= i; ++j)
        {
            C[i][j] = (C[i - 1][j - 1] + C[i - 1][j]) % P;
        }
    }
    sort(a + 1, a + n + 1); sort(b + 1, b + n + 1);
    for(int i = 0; i <= n; ++i) F[i][0] = 1;
    for(int i = 1, p = 0; i <= n; ++i)
    {
        while(p + 1 <= n && b[p + 1] < a[i]) ++p;
        for(int j = 1; j <= n; ++j)
        {
            F[i][j] = (F[i - 1][j] + 1LL * F[i - 1][j - 1] * (p - j + 1) % P) % P;
        }
    }
    for(int j = n, s = 1; j >= 1; --j)
    {
        f[j] = 1LL * F[n][j] * s % P;
        s = 1LL * s * (n - j + 1) % P;
    }

    int ans = 0, x = (n + k) / 2;
    for(int i = x; i <= n; ++i)
    {
        int s = 1LL * C[i][x] * f[i] % P;
        if((i - x) & 1) ans = (ans - s + P) % P;
        else ans = (ans + s) % P;
    }
    printf("%d\n", ans);

    return 0;
}